//
//  AccountCapitalViewController.m
//  bitcoin
//
//  Created by caiyajun on 2018/5/10.
//  Copyright © 2018年 比特币. All rights reserved.
//

#import "AccountCapitalViewController.h"
#import "AccountCapitalCell.h"
@interface AccountCapitalViewController ()
@property (weak, nonatomic) IBOutlet UIButton *eyeBtn;
- (IBAction)changeEyeAction:(UIButton *)sender;
@property (weak, nonatomic) IBOutlet UILabel *btcLabel;
@property (weak, nonatomic) IBOutlet UILabel *cnfLabel;

@end

@implementation AccountCapitalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [_eyeBtn setImage:[UIImage imageNamed:@"open-icon-1"] forState:UIControlStateNormal];
    [_eyeBtn setImage:[UIImage imageNamed:@"close-icon-2"] forState:UIControlStateSelected];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    AccountCapitalCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccountCapitalCell" forIndexPath:indexPath];
    
    return cell;
    
}

- (CGFloat )tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 105.0f;
}
-(void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath{
    if (indexPath.row==0) {
        [self performSegueWithIdentifier:@"rinseMoneySegue" sender:nil];
    }else{
        [self performSegueWithIdentifier:@"drawMoneySegue" sender:nil];
    }
    
    
}
- (IBAction)changeEyeAction:(UIButton *)sender {
    if (!sender.selected) {
        self.btcLabel.text=@"*** BTC";
        self.cnfLabel.text=@"*** CNY";
    }else{
        self.btcLabel.text=@"7.25780000 BTC";
        self.cnfLabel.text=@"≈ 567895.12 CNY";
    }
    sender.selected = !sender.selected;
    
}
@end
